package com.project.webapp.action.backend;

import com.project.common.util.QueryUtils;
import com.project.dao.bean.Organization;
import com.project.service.backend.OrganizationService;
import com.project.webapp.action.BaseAction;

/**
 * 组织注册 Action
 * @author Sn
 *
 */
public class OrginAction extends BaseAction 
{
	private Organization organ;
	private OrganizationService organService;
	private QueryUtils queryUtils;

	// 机构信息添加方法
	public String save() 
	{
		organService.save(organ);
		return SUCCESS;
	}

	// 根据id删除指定的机构
	public String deleteorgin() 
	{
		organService.deleteorgin(organ.getOrg_id());
		return "successdelete";
	}

	// 根据id返回相应一条对应的记录
	public String findbyid() 
	{
		organ = organService.findbyid(organ.getOrg_id());
		return "successfindbyid";
	}

	// 修改机构信息
	public String updateorgin() 
	{
		organService.updateorgin(organ);
		return "successupdateorgin";
	}

	// 带分页的显示方法
	public String listorgin() 
	{
		queryUtils.setLocation(new StringBuffer("orgin!listorgin.action"));
		queryUtils = organService.listorgin(queryUtils);
		return "successlistorgin";
	}

	public Organization getOrgan() {
		return organ;
	}

	public void setOrgan(Organization organ) {
		this.organ = organ;
	}

	public OrganizationService getOrganService() {
		return organService;
	}

	public void setOrganService(OrganizationService organService) {
		this.organService = organService;
	}

	public QueryUtils getQueryUtils() {
		return queryUtils;
	}

	public void setQueryUtils(QueryUtils queryUtils) {
		this.queryUtils = queryUtils;
	}

}
